import request from '@/utils/request'

export const getList = (data: any, page: number, limit: number) =>
  request({
    url: `/api/block/list?page=${page}&limit=${limit}`,
    method: 'post',
    data
  })

export const getCustomerList = (data: any) =>
  request({
    url: '/api/block/customerList',
    method: 'post',
    data
  })

export const setBlockGroupCollect = (data: any) =>
  request({
    url: '/api/block/setDiyGroup',
    method: 'post',
    data
  })

export const setBlockSourceCollect = (data: any) =>
  request({
    url: '/api/block/setSource',
    method: 'post',
    data
  })

export const setBlockLabelCollect = (data: any) =>
  request({
    url: '/api/block/setLabel',
    method: 'post',
    data
  })

export const SetIsPrivate = (data: any) =>
  request({
    url: '/api/block/setIsPrivate',
    method: 'post',
    data
  })

export const setBlockIsIntention = (data: any) =>
  request({
    url: '/api/block/setIsIntention',
    method: 'post',
    data
  })

export const getCustomers = (data: any) =>
  request({
    url: '/api/block/getCustomers',
    method: 'post',
    data
  })

export const getBlock = (id: number) =>
  request({
    url: `/api/block/${id}`,
    method: 'get',
  })

export const createBlock = (data: any) =>
  request({
    url: '/api/block/create',
    method: 'post',
    data
  })

export const updateBlock = (id: number, data: any) =>
  request({
    url: `/api/block/${id}`,
    method: 'put',
    data
  })
export const deleteBlock = (data: any) =>
  request({
    url: `/api/block/delete`,
    method: 'post',
    data
  })


export const getExportCustomer = (data: any) =>
  request({
    url: '/api/block/customerExportList',
    method: 'post',
    data
  })
